home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 October: Mac OS SDK / Dev.CD Oct 00 SDK1.toast / Development Kits / Cross Platform / QuickTime 4.1.2 Windows SDK / CIncludes / SpeechRecognition.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-12  |  21.9 KB  |  509 lines  |  [TEXT/R*ch]

  1. /*
  2.      File:        SpeechRecognition.h
  3.  
  4.      Contains:    Apple Speech Recognition Toolbox Interfaces.
  5.  
  6.      Version:    Technology:    PlainTalk 1.5
  7.                  Release:    QuickTime 4.1
  8.  
  9.      Copyright:    (c) 1992-1999 by Apple Computer, Inc., all rights reserved.
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __SPEECHRECOGNITION__
  18. #define __SPEECHRECOGNITION__
  19.  
  20. #ifndef __MACTYPES__
  21.     #include <MacTypes.h>
  22. #endif
  23.  
  24. #ifndef __MIXEDMODE__
  25.     #include <MixedMode.h>
  26. #endif
  27.  
  28.  
  29.  
  30.  
  31. #if PRAGMA_ONCE
  32. #pragma once
  33. #endif
  34.  
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38.  
  39. #if PRAGMA_IMPORT
  40. #pragma import on
  41. #endif
  42.  
  43. #if PRAGMA_STRUCT_ALIGN
  44.     #pragma options align=mac68k
  45. #elif PRAGMA_STRUCT_PACKPUSH
  46.     #pragma pack(push, 2)
  47. #elif PRAGMA_STRUCT_PACK
  48.     #pragma pack(2)
  49. #endif
  50.  
  51. /* Error Codes [Speech recognition gets -5100 through -5199] */
  52. enum {
  53.     kSRNotAvailable                = -5100,                        /* the service requested is not avail or applicable */
  54.     kSRInternalError            = -5101,                        /* a system internal or hardware error condition */
  55.     kSRComponentNotFound        = -5102,                        /* a needed system resource was not located */
  56.     kSROutOfMemory                = -5103,                        /* an out of memory error occurred in the toolbox memory space */
  57.     kSRNotASpeechObject            = -5104,                        /* the object specified is no longer or never was valid */
  58.     kSRBadParameter                = -5105,                        /* an invalid parameter was specified */
  59.     kSRParamOutOfRange            = -5106,                        /* when we say 0-100, don't pass in 101. */
  60.     kSRBadSelector                = -5107,                        /* an unrecognized selector was specified */
  61.     kSRBufferTooSmall            = -5108,                        /* returned from attribute access functions */
  62.     kSRNotARecSystem            = -5109,                        /* the object used was not a SRRecognitionSystem */
  63.     kSRFeedbackNotAvail            = -5110,                        /* there is no feedback window associated with SRRecognizer */
  64.     kSRCantSetProperty            = -5111,                        /* a non-settable property was specified */
  65.     kSRCantGetProperty            = -5112,                        /* a non-gettable property was specified */
  66.     kSRCantSetDuringRecognition    = -5113,                        /* the property can't be set while recognition is in progress -- do before or between utterances. */
  67.     kSRAlreadyListening            = -5114,                        /* in response to SRStartListening */
  68.     kSRNotListeningState        = -5115,                        /* in response to SRStopListening */
  69.     kSRModelMismatch            = -5116,                        /* no acoustical models are avail to match request */
  70.     kSRNoClientLanguageModel    = -5117,                        /* trying to access a non-specified SRLanguageModel */
  71.     kSRNoPendingUtterances        = -5118,                        /* nothing to continue search on */
  72.     kSRRecognitionCanceled        = -5119,                        /* an abort error occurred during search */
  73.     kSRRecognitionDone            = -5120,                        /* search has finished, but nothing was recognized */
  74.     kSROtherRecAlreadyModal        = -5121,                        /* another recognizer is modal at the moment, so can't set this recognizer's kSRBlockModally property right now */
  75.     kSRHasNoSubItems            = -5122,                        /* SRCountItems or related routine was called on an object without subelements -- e.g. a word -- rather than phrase, path, or LM. */
  76.     kSRSubItemNotFound            = -5123,                        /* returned when accessing a non-existent sub item of a container */
  77.     kSRLanguageModelTooBig        = -5124,                        /* Cant build language models so big */
  78.     kSRAlreadyReleased            = -5125,                        /* this object has already been released before */
  79.     kSRAlreadyFinished            = -5126,                        /* the language model can't be finished twice */
  80.     kSRWordNotFound                = -5127,                        /* the spelling couldn't be found in lookup(s) */
  81.     kSRNotFinishedWithRejection    = -5128,                        /* property not found because the LMObj is not finished with rejection */
  82.     kSRExpansionTooDeep            = -5129,                        /* Language model is left recursive or is embedded too many levels */
  83.     kSRTooManyElements            = -5130,                        /* Too many elements added to phrase or path or other langauge model object */
  84.     kSRCantAdd                    = -5131,                        /* Can't add given type of object to the base SRLanguageObject (e.g.in SRAddLanguageObject)    */
  85.     kSRSndInSourceDisconnected    = -5132,                        /* Sound input source is disconnected */
  86.     kSRCantReadLanguageObject    = -5133,                        /* An error while trying to create new Language object from file or pointer -- possibly bad format */
  87.                                                                 /* non-release debugging error codes are included here */
  88.     kSRNotImplementedYet        = -5199                            /* you'd better wait for this feature in a future release */
  89. };
  90.  
  91.  
  92. /* Type Definitions */
  93. typedef struct OpaqueSRSpeechObject*     SRSpeechObject;
  94. typedef SRSpeechObject                     SRRecognitionSystem;
  95. typedef SRSpeechObject                     SRRecognizer;
  96. typedef SRSpeechObject                     SRSpeechSource;
  97. typedef SRSpeechSource                     SRRecognitionResult;
  98. typedef SRSpeechObject                     SRLanguageObject;
  99. typedef SRLanguageObject                 SRLanguageModel;
  100. typedef SRLanguageObject                 SRPath;
  101. typedef SRLanguageObject                 SRPhrase;
  102. typedef SRLanguageObject                 SRWord;
  103. /* between 0 and 100 */
  104. typedef unsigned short                     SRSpeedSetting;
  105. /* between 0 and 100 */
  106. typedef unsigned short                     SRRejectionLevel;
  107. /* When an event occurs, the user supplied proc will be called with a pointer    */
  108. /*    to the param passed in and a flag to indicate conditions such                */
  109. /*    as interrupt time or system background time.                                */
  110.  
  111. struct SRCallBackStruct {
  112.     long                             what;                        /* one of notification flags */
  113.     long                             message;                    /* contains SRRecognitionResult id */
  114.     SRRecognizer                     instance;                    /* ID of recognizer being notified */
  115.     OSErr                             status;                        /* result status of last search */
  116.     short                             flags;                        /* non-zero if occurs during interrupt */
  117.     long                             refCon;                        /* user defined - set from SRCallBackParam */
  118. };
  119. typedef struct SRCallBackStruct            SRCallBackStruct;
  120. /* Call back procedure definition */
  121. typedef CALLBACK_API( void , SRCallBackProcPtr )(SRCallBackStruct *param);
  122. typedef STACK_UPP_TYPE(SRCallBackProcPtr)                         SRCallBackUPP;
  123. #if OPAQUE_UPP_TYPES
  124.     EXTERN_API(SRCallBackUPP)
  125.     NewSRCallBackUPP               (SRCallBackProcPtr        userRoutine);
  126.  
  127.     EXTERN_API(void)
  128.     DisposeSRCallBackUPP           (SRCallBackUPP            userUPP);
  129.  
  130.     EXTERN_API(void)
  131.     InvokeSRCallBackUPP               (SRCallBackStruct *        param,
  132.                                     SRCallBackUPP            userUPP);
  133.  
  134. #else
  135.     enum { uppSRCallBackProcInfo = 0x000000C0 };                     /* pascal no_return_value Func(4_bytes) */
  136.     #define NewSRCallBackUPP(userRoutine)                             (SRCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppSRCallBackProcInfo, GetCurrentArchitecture())
  137.     #define DisposeSRCallBackUPP(userUPP)                             DisposeRoutineDescriptor(userUPP)
  138.     #define InvokeSRCallBackUPP(param, userUPP)                     CALL_ONE_PARAMETER_UPP((userUPP), uppSRCallBackProcInfo, (param))
  139. #endif
  140. /* support for pre-Carbon UPP routines: NewXXXProc and CallXXXProc */
  141. #define NewSRCallBackProc(userRoutine)                             NewSRCallBackUPP(userRoutine)
  142. #define CallSRCallBackProc(userRoutine, param)                    InvokeSRCallBackUPP(param, userRoutine)
  143.  
  144. struct SRCallBackParam {
  145.     SRCallBackUPP                     callBack;
  146.     long                             refCon;
  147. };
  148. typedef struct SRCallBackParam            SRCallBackParam;
  149. /* Recognition System Types */
  150. enum {
  151.     kSRDefaultRecognitionSystemID = 0
  152. };
  153.  
  154. /* Recognition System Properties */
  155. enum {
  156.     kSRFeedbackAndListeningModes = FOUR_CHAR_CODE('fbwn'),        /* short: one of kSRNoFeedbackHasListenModes, kSRHasFeedbackHasListenModes, kSRNoFeedbackNoListenModes */
  157.     kSRRejectedWord                = FOUR_CHAR_CODE('rejq'),        /* the SRWord used to represent a rejection */
  158.     kSRCleanupOnClientExit        = FOUR_CHAR_CODE('clup')        /* Boolean: Default is true. The rec system and everything it owns is disposed when the client application quits */
  159. };
  160.  
  161. enum {
  162.     kSRNoFeedbackNoListenModes    = 0,                            /* next allocated recognizer has no feedback window and doesn't use listening modes    */
  163.     kSRHasFeedbackHasListenModes = 1,                            /* next allocated recognizer has feedback window and uses listening modes             */
  164.     kSRNoFeedbackHasListenModes    = 2                                /* next allocated recognizer has no feedback window but does use listening modes     */
  165. };
  166.  
  167. /* Speech Source Types */
  168. enum {
  169.     kSRDefaultSpeechSource        = 0,
  170.     kSRLiveDesktopSpeechSource    = FOUR_CHAR_CODE('dklv'),        /* live desktop sound input */
  171.     kSRCanned22kHzSpeechSource    = FOUR_CHAR_CODE('ca22')        /* AIFF file based 16 bit, 22.050 KHz sound input */
  172. };
  173.  
  174. /* Notification via Apple Event or Callback */
  175. /* Notification Flags */
  176. enum {
  177.     kSRNotifyRecognitionBeginning = 1L << 0,                    /* recognition can begin. client must now call SRContinueRecognition or SRCancelRecognition */
  178.     kSRNotifyRecognitionDone    = 1L << 1                        /* recognition has terminated. result (if any) is available. */
  179. };
  180.  
  181. /* Apple Event selectors */
  182. /* AppleEvent message class  */
  183. enum {
  184.     kAESpeechSuite                = FOUR_CHAR_CODE('sprc')
  185. };
  186.  
  187. /* AppleEvent message event ids */
  188. enum {
  189.     kAESpeechDone                = FOUR_CHAR_CODE('srsd'),
  190.     kAESpeechDetected            = FOUR_CHAR_CODE('srbd')
  191. };
  192.  
  193. /* AppleEvent Parameter ids */
  194. enum {
  195.     keySRRecognizer                = FOUR_CHAR_CODE('krec'),
  196.     keySRSpeechResult            = FOUR_CHAR_CODE('kspr'),
  197.     keySRSpeechStatus            = FOUR_CHAR_CODE('ksst')
  198. };
  199.  
  200. /* AppleEvent Parameter types */
  201. enum {
  202.     typeSRRecognizer            = FOUR_CHAR_CODE('trec'),
  203.     typeSRSpeechResult            = FOUR_CHAR_CODE('tspr')
  204. };
  205.  
  206.  
  207. /* SRRecognizer Properties */
  208. enum {
  209.     kSRNotificationParam        = FOUR_CHAR_CODE('noti'),        /* see notification flags below */
  210.     kSRCallBackParam            = FOUR_CHAR_CODE('call'),        /* type SRCallBackParam */
  211.     kSRSearchStatusParam        = FOUR_CHAR_CODE('stat'),        /* see status flags below */
  212.     kSRAutoFinishingParam        = FOUR_CHAR_CODE('afin'),        /* automatic finishing applied on LM for search */
  213.     kSRForegroundOnly            = FOUR_CHAR_CODE('fgon'),        /* Boolean. Default is true. If true, client recognizer only active when in foreground.    */
  214.     kSRBlockBackground            = FOUR_CHAR_CODE('blbg'),        /* Boolean. Default is false. If true, when client recognizer in foreground, rest of LMs are inactive.    */
  215.     kSRBlockModally                = FOUR_CHAR_CODE('blmd'),        /* Boolean. Default is false. When true, this client's LM is only active LM; all other LMs are inactive. Be nice, don't be modal for long periods! */
  216.     kSRWantsResultTextDrawn        = FOUR_CHAR_CODE('txfb'),        /* Boolean. Default is true. If true, search results are posted to Feedback window */
  217.     kSRWantsAutoFBGestures        = FOUR_CHAR_CODE('dfbr'),        /* Boolean. Default is true. If true, client needn't call SRProcessBegin/End to get default feedback behavior */
  218.     kSRSoundInVolume            = FOUR_CHAR_CODE('volu'),        /* short in [0..100] log scaled sound input power. Can't set this property */
  219.     kSRReadAudioFSSpec            = FOUR_CHAR_CODE('aurd'),        /* *FSSpec. Specify FSSpec where raw audio is to be read (AIFF format) using kSRCanned22kHzSpeechSource. Reads until EOF */
  220.     kSRCancelOnSoundOut            = FOUR_CHAR_CODE('caso'),        /* Boolean: Default is true.  If any sound is played out during utterance, recognition is aborted. */
  221.     kSRSpeedVsAccuracyParam        = FOUR_CHAR_CODE('sped')        /* SRSpeedSetting between 0 and 100 */
  222. };
  223.  
  224. /* 0 means more accurate but slower. */
  225. /* 100 means (much) less accurate but faster. */
  226. enum {
  227.     kSRUseToggleListen            = 0,                            /* listen key modes */
  228.     kSRUsePushToTalk            = 1
  229. };
  230.  
  231. enum {
  232.     kSRListenKeyMode            = FOUR_CHAR_CODE('lkmd'),        /* short: either kSRUseToggleListen or kSRUsePushToTalk */
  233.     kSRListenKeyCombo            = FOUR_CHAR_CODE('lkey'),        /* short: Push-To-Talk key combination; high byte is high byte of event->modifiers, the low byte is the keycode from event->message */
  234.     kSRListenKeyName            = FOUR_CHAR_CODE('lnam'),        /* Str63: string representing ListenKeyCombo */
  235.     kSRKeyWord                    = FOUR_CHAR_CODE('kwrd'),        /* Str255: keyword preceding spoken commands in kSRUseToggleListen mode */
  236.     kSRKeyExpected                = FOUR_CHAR_CODE('kexp')        /* Boolean: Must the PTT key be depressed or the key word spoken before recognition can occur? */
  237. };
  238.  
  239. /* Operational Status Flags */
  240. enum {
  241.     kSRIdleRecognizer            = 1L << 0,                        /* engine is not active */
  242.     kSRSearchInProgress            = 1L << 1,                        /* search is in progress */
  243.     kSRSearchWaitForAllClients    = 1L << 2,                        /* search is suspended waiting on all clients' input */
  244.     kSRMustCancelSearch            = 1L << 3,                        /* something has occurred (sound played, non-speech detected) requiring the search to abort */
  245.     kSRPendingSearch            = 1L << 4                        /* we're about to start searching */
  246. };
  247.  
  248. /* Recognition Result Properties */
  249. enum {
  250.     kSRTEXTFormat                = FOUR_CHAR_CODE('TEXT'),        /* raw text in user supplied memory */
  251.     kSRPhraseFormat                = FOUR_CHAR_CODE('lmph'),        /* SRPhrase containing result words */
  252.     kSRPathFormat                = FOUR_CHAR_CODE('lmpt'),        /* SRPath containing result phrases or words */
  253.     kSRLanguageModelFormat        = FOUR_CHAR_CODE('lmfm')        /* top level SRLanguageModel for post parse */
  254. };
  255.  
  256. /* SRLanguageObject Family Properties */
  257. enum {
  258.     kSRSpelling                    = FOUR_CHAR_CODE('spel'),        /* spelling of a SRWord or SRPhrase or SRPath, or name of a SRLanguageModel */
  259.     kSRLMObjType                = FOUR_CHAR_CODE('lmtp'),        /* Returns one of SRLanguageObject Types listed below */
  260.     kSRRefCon                    = FOUR_CHAR_CODE('refc'),        /* 4 bytes of user storage */
  261.     kSROptional                    = FOUR_CHAR_CODE('optl'),        /* Boolean -- true if SRLanguageObject is optional    */
  262.     kSREnabled                    = FOUR_CHAR_CODE('enbl'),        /* Boolean -- true if SRLanguageObject enabled */
  263.     kSRRepeatable                = FOUR_CHAR_CODE('rptb'),        /* Boolean -- true if SRLanguageObject is repeatable */
  264.     kSRRejectable                = FOUR_CHAR_CODE('rjbl'),        /* Boolean -- true if SRLanguageObject is rejectable (Recognition System's kSRRejectedWord */
  265.                                                                 /*        object can be returned in place of SRLanguageObject with this property)    */
  266.     kSRRejectionLevel            = FOUR_CHAR_CODE('rjct')        /* SRRejectionLevel between 0 and 100 */
  267. };
  268.  
  269. /* LM Object Types -- returned as kSRLMObjType property of language model objects */
  270. enum {
  271.     kSRLanguageModelType        = FOUR_CHAR_CODE('lmob'),        /* SRLanguageModel */
  272.     kSRPathType                    = FOUR_CHAR_CODE('path'),        /* SRPath */
  273.     kSRPhraseType                = FOUR_CHAR_CODE('phra'),        /* SRPhrase */
  274.     kSRWordType                    = FOUR_CHAR_CODE('word')        /* SRWord */
  275. };
  276.  
  277. /* a normal and reasonable rejection level */
  278. enum {
  279.     kSRDefaultRejectionLevel    = 50
  280. };
  281.  
  282. /********************************************************************************/
  283. /*                        NOTES ON USING THE API                                    */
  284. /*                                                                                */
  285. /*        All operations (with the exception of SRGetRecognitionSystem) are        */
  286. /*        directed toward an object allocated or begot from New, Get and Read        */
  287. /*        type calls.                                                                */
  288. /*                                                                                */
  289. /*        There is a simple rule in dealing with allocation and disposal:            */
  290. /*                                                                                */
  291. /*        *    all toolbox allocations are obtained from a SRRecognitionSystem        */
  292. /*                                                                                */
  293. /*        *    if you obtain an object via New or Get, then you own a reference     */
  294. /*            to that object and it must be released via SRReleaseObject when        */
  295. /*            you no longer need it                                                */
  296. /*                                                                                */
  297. /*        *    when you receive a SRRecognitionResult object via AppleEvent or        */
  298. /*            callback, it has essentially been created on your behalf and so        */
  299. /*            you are responsible for releasing it as above                        */
  300. /*                                                                                */
  301. /*        *    when you close a SRRecognitionSystem, all remaining objects which        */
  302. /*            were allocated with it will be forcefully released and any            */
  303. /*            remaining references to those objects will be invalid.                */
  304. /*                                                                                */
  305. /*        This translates into a very simple guideline:                            */
  306. /*            If you allocate it or have it allocated for you, you must release    */
  307. /*            it.  If you are only peeking at it, then don't release it.            */
  308. /*                                                                                */
  309. /********************************************************************************/
  310. /* Opening and Closing of the SRRecognitionSystem */
  311. EXTERN_API( OSErr )
  312. SROpenRecognitionSystem            (SRRecognitionSystem *    system,
  313.                                  OSType                 systemID)                            THREEWORDINLINE(0x303C, 0x0400, 0xAA56);
  314.  
  315. EXTERN_API( OSErr )
  316. SRCloseRecognitionSystem        (SRRecognitionSystem     system)                                THREEWORDINLINE(0x303C, 0x0201, 0xAA56);
  317.  
  318. /* Accessing Properties of any Speech Object */
  319. EXTERN_API( OSErr )
  320. SRSetProperty                    (SRSpeechObject         srObject,
  321.                                  OSType                 selector,
  322.                                  const void *            property,
  323.                                  Size                     propertyLen)                        THREEWORDINLINE(0x303C, 0x0802, 0xAA56);
  324.  
  325. EXTERN_API( OSErr )
  326. SRGetProperty                    (SRSpeechObject         srObject,
  327.                                  OSType                 selector,
  328.                                  void *                    property,
  329.                                  Size *                    propertyLen)                        THREEWORDINLINE(0x303C, 0x0803, 0xAA56);
  330.  
  331. /* Any object obtained via New or Get type calls must be released */
  332. EXTERN_API( OSErr )
  333. SRReleaseObject                    (SRSpeechObject         srObject)                            THREEWORDINLINE(0x303C, 0x0204, 0xAA56);
  334.  
  335. EXTERN_API( OSErr )
  336. SRGetReference                    (SRSpeechObject         srObject,
  337.                                  SRSpeechObject *        newObjectRef)                        THREEWORDINLINE(0x303C, 0x0425, 0xAA56);
  338.  
  339. /* SRRecognizer Instance Functions */
  340. EXTERN_API( OSErr )
  341. SRNewRecognizer                    (SRRecognitionSystem     system,
  342.                                  SRRecognizer *            recognizer,
  343.                                  OSType                 sourceID)                            THREEWORDINLINE(0x303C, 0x060A, 0xAA56);
  344.  
  345. EXTERN_API( OSErr )
  346. SRStartListening                (SRRecognizer             recognizer)                            THREEWORDINLINE(0x303C, 0x020C, 0xAA56);
  347.  
  348. EXTERN_API( OSErr )
  349. SRStopListening                    (SRRecognizer             recognizer)                            THREEWORDINLINE(0x303C, 0x020D, 0xAA56);
  350.  
  351. EXTERN_API( OSErr )
  352. SRSetLanguageModel                (SRRecognizer             recognizer,
  353.                                  SRLanguageModel         languageModel)                        THREEWORDINLINE(0x303C, 0x040E, 0xAA56);
  354.  
  355. EXTERN_API( OSErr )
  356. SRGetLanguageModel                (SRRecognizer             recognizer,
  357.                                  SRLanguageModel *        languageModel)                        THREEWORDINLINE(0x303C, 0x040F, 0xAA56);
  358.  
  359. EXTERN_API( OSErr )
  360. SRContinueRecognition            (SRRecognizer             recognizer)                            THREEWORDINLINE(0x303C, 0x0210, 0xAA56);
  361.  
  362. EXTERN_API( OSErr )
  363. SRCancelRecognition                (SRRecognizer             recognizer)                            THREEWORDINLINE(0x303C, 0x0211, 0xAA56);
  364.  
  365. EXTERN_API( OSErr )
  366. SRIdle                            (void)                                                        THREEWORDINLINE(0x303C, 0x0028, 0xAA56);
  367.  
  368. /* Language Model Building and Manipulation Functions */
  369. EXTERN_API( OSErr )
  370. SRNewLanguageModel                (SRRecognitionSystem     system,
  371.                                  SRLanguageModel *        model,
  372.                                  const void *            name,
  373.                                  Size                     nameLength)                            THREEWORDINLINE(0x303C, 0x0812, 0xAA56);
  374.  
  375. EXTERN_API( OSErr )
  376. SRNewPath                        (SRRecognitionSystem     system,
  377.                                  SRPath *                path)                                THREEWORDINLINE(0x303C, 0x0413, 0xAA56);
  378.  
  379. EXTERN_API( OSErr )
  380. SRNewPhrase                        (SRRecognitionSystem     system,
  381.                                  SRPhrase *                phrase,
  382.                                  const void *            text,
  383.                                  Size                     textLength)                            THREEWORDINLINE(0x303C, 0x0814, 0xAA56);
  384.  
  385. EXTERN_API( OSErr )
  386. SRNewWord                        (SRRecognitionSystem     system,
  387.                                  SRWord *                word,
  388.                                  const void *            text,
  389.                                  Size                     textLength)                            THREEWORDINLINE(0x303C, 0x0815, 0xAA56);
  390.  
  391. /* Operations on any object of the SRLanguageObject family */
  392. EXTERN_API( OSErr )
  393. SRPutLanguageObjectIntoHandle    (SRLanguageObject         languageObject,
  394.                                  Handle                 lobjHandle)                            THREEWORDINLINE(0x303C, 0x0416, 0xAA56);
  395.  
  396. EXTERN_API( OSErr )
  397. SRPutLanguageObjectIntoDataFile    (SRLanguageObject         languageObject,
  398.                                  short                     fRefNum)                            THREEWORDINLINE(0x303C, 0x0328, 0xAA56);
  399.  
  400. EXTERN_API( OSErr )
  401. SRNewLanguageObjectFromHandle    (SRRecognitionSystem     system,
  402.                                  SRLanguageObject *        languageObject,
  403.                                  Handle                 lObjHandle)                            THREEWORDINLINE(0x303C, 0x0417, 0xAA56);
  404.  
  405. EXTERN_API( OSErr )
  406. SRNewLanguageObjectFromDataFile    (SRRecognitionSystem     system,
  407.                                  SRLanguageObject *        languageObject,
  408.                                  short                     fRefNum)                            THREEWORDINLINE(0x303C, 0x0427, 0xAA56);
  409.  
  410. EXTERN_API( OSErr )
  411. SREmptyLanguageObject            (SRLanguageObject         languageObject)                        THREEWORDINLINE(0x303C, 0x0218, 0xAA56);
  412.  
  413. EXTERN_API( OSErr )
  414. SRChangeLanguageObject            (SRLanguageObject         languageObject,
  415.                                  const void *            text,
  416.                                  Size                     textLength)                            THREEWORDINLINE(0x303C, 0x0619, 0xAA56);
  417.  
  418. EXTERN_API( OSErr )
  419. SRAddLanguageObject                (SRLanguageObject         base,
  420.                                  SRLanguageObject         addon)                                THREEWORDINLINE(0x303C, 0x041A, 0xAA56);
  421.  
  422. EXTERN_API( OSErr )
  423. SRAddText                        (SRLanguageObject         base,
  424.                                  const void *            text,
  425.                                  Size                     textLength,
  426.                                  long                     refCon)                                THREEWORDINLINE(0x303C, 0x081B, 0xAA56);
  427.  
  428. EXTERN_API( OSErr )
  429. SRRemoveLanguageObject            (SRLanguageObject         base,
  430.                                  SRLanguageObject         toRemove)                            THREEWORDINLINE(0x303C, 0x041C, 0xAA56);
  431.  
  432. /* Traversing SRRecognitionResults or SRLanguageObjects */
  433. EXTERN_API( OSErr )
  434. SRCountItems                    (SRSpeechObject         container,
  435.                                  long *                    count)                                THREEWORDINLINE(0x303C, 0x0405, 0xAA56);
  436.  
  437. EXTERN_API( OSErr )
  438. SRGetIndexedItem                (SRSpeechObject         container,
  439.                                  SRSpeechObject *        item,
  440.                                  long                     index)                                THREEWORDINLINE(0x303C, 0x0606, 0xAA56);
  441.  
  442. EXTERN_API( OSErr )
  443. SRSetIndexedItem                (SRSpeechObject         container,
  444.                                  SRSpeechObject         item,
  445.                                  long                     index)                                THREEWORDINLINE(0x303C, 0x0607, 0xAA56);
  446.  
  447. EXTERN_API( OSErr )
  448. SRRemoveIndexedItem                (SRSpeechObject         container,
  449.                                  long                     index)                                THREEWORDINLINE(0x303C, 0x0408, 0xAA56);
  450.  
  451. /* Utilizing the System Feedback Window */
  452. EXTERN_API( OSErr )
  453. SRDrawText                        (SRRecognizer             recognizer,
  454.                                  const void *            dispText,
  455.                                  Size                     dispLength)                            THREEWORDINLINE(0x303C, 0x0621, 0xAA56);
  456.  
  457. EXTERN_API( OSErr )
  458. SRDrawRecognizedText            (SRRecognizer             recognizer,
  459.                                  const void *            dispText,
  460.                                  Size                     dispLength)                            THREEWORDINLINE(0x303C, 0x0622, 0xAA56);
  461.  
  462. EXTERN_API( OSErr )
  463. SRSpeakText                        (SRRecognizer             recognizer,
  464.                                  const void *            speakText,
  465.                                  Size                     speakLength)                        THREEWORDINLINE(0x303C, 0x0620, 0xAA56);
  466.  
  467. EXTERN_API( OSErr )
  468. SRSpeakAndDrawText                (SRRecognizer             recognizer,
  469.                                  const void *            text,
  470.                                  Size                     textLength)                            THREEWORDINLINE(0x303C, 0x061F, 0xAA56);
  471.  
  472. EXTERN_API( OSErr )
  473. SRStopSpeech                    (SRRecognizer             recognizer)                            THREEWORDINLINE(0x303C, 0x0223, 0xAA56);
  474.  
  475. EXTERN_API( Boolean )
  476. SRSpeechBusy                    (SRRecognizer             recognizer)                            THREEWORDINLINE(0x303C, 0x0224, 0xAA56);
  477.  
  478. EXTERN_API( OSErr )
  479. SRProcessBegin                    (SRRecognizer             recognizer,
  480.                                  Boolean                 failed)                                THREEWORDINLINE(0x303C, 0x031D, 0xAA56);
  481.  
  482. EXTERN_API( OSErr )
  483. SRProcessEnd                    (SRRecognizer             recognizer,
  484.                                  Boolean                 failed)                                THREEWORDINLINE(0x303C, 0x031E, 0xAA56);
  485.  
  486.  
  487.  
  488.  
  489. #if PRAGMA_STRUCT_ALIGN
  490.     #pragma options align=reset
  491. #elif PRAGMA_STRUCT_PACKPUSH
  492.     #pragma pack(pop)
  493. #elif PRAGMA_STRUCT_PACK
  494.     #pragma pack()
  495. #endif
  496.  
  497. #ifdef PRAGMA_IMPORT_OFF
  498. #pragma import off
  499. #elif PRAGMA_IMPORT
  500. #pragma import reset
  501. #endif
  502.  
  503. #ifdef __cplusplus
  504. }
  505. #endif
  506.  
  507. #endif /* __SPEECHRECOGNITION__ */
  508.  
  509.